﻿Shader "Unlit/LightBall"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
    }
    SubShader
    {

        Tags{"Queue" = "Transparent"}
        Pass
        {

            Tags{"LightMode" = "ForwardBase"}
            Blend SrcAlpha OneMinusSrcAlpha   
            CGPROGRAM

            #pragma vertex vert
            #pragma fragment frag 

            #include "Lighting.cginc"
            #include "AutoLight.cginc"

            sampler2D _MainTex;
            float2 _MainTex_ST;

            struct v2f{
                float4 pos : SV_POSITION;
                float distance : TEXCOORD0;
                float2 uv : TEXCOORD1;
            };
            v2f vert(appdata_base v)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(v.vertex);
                o.distance = dot(v.vertex, v.vertex);
                o.distance*=0.5;
                return o;
            }

            fixed4 frag(v2f i) : SV_Target
            {
                return fixed4(i.distance, i.distance, i.distance, i.distance);
            }

            ENDCG
        }
    }
    FallBack "Specular"
}
